package com.asset.dispoal.company.domain.db.mapper;

import com.asset.dispoal.company.domain.db.entity.CompanyTempStatistics;
import com.asset.dispoal.company.domain.db.entity.SysCompanyDo;
import com.asset.dispoal.company.dto.CompanySelectResponse;
import com.asset.dispoal.company.dto.CompanySelected;
import com.asset.dispoal.company.dto.PlaintiffCourtRequest;
import com.asset.dispoal.user.dto.UserRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import tech.mhuang.pacebox.springboot.protocol.data.Page;

import java.util.List;

/**
 * 债行公司表JDBC接口
 *
 * @author: mhuang
 * @date: 2022-01-25 09:38:17
 */
@Mapper
public interface SysCompanyMapper {


    void insert(@Param("companyDo") SysCompanyDo companyDo);

    void update(@Param("companyDo") SysCompanyDo companyDo);

    void delete(@Param("id") String id);

    SysCompanyDo getById(@Param("id") String id);

    List<SysCompanyDo> queryAll(@Param("companyDo") SysCompanyDo companyDo);


    Integer pageCount(@Param("companyDo") SysCompanyDo companyDo);

    List<SysCompanyDo> queryPage(@Param("page") Page<SysCompanyDo> page);

    UserRequest queryRoleDepByCompanyType(@Param("type") String type);

    List<CompanySelectResponse> queryCourtByPlaintiffId(PlaintiffCourtRequest request);

    /**
     * 判断公司编码是否存在
     *
     * @param code
     * @param type
     * @return
     */
    short queryCompanyCodeExist(String code, String type);

    /**
     * 判断公司编码是否存在(更新时使用)
     *
     * @param code
     * @param type
     * @param id
     * @return
     */
    short queryCompanyCodeExistExpect(CharSequence code, String type, String id);

    List<CompanySelected> queryLawFirmSelected(@Param("id") String lawFirmId);

    Integer deleteLawFirmCourt(@Param("lawFirmId") String lawFirmId);

    Integer insertLawFirmCourt(@Param("lawFirmId") String lawFirmId, @Param("courtId") String courtId);

    List<CompanySelected> queryCourtSelected(@Param("courtId") String courtId);

    Integer deleteCourtArea(@Param("courtId") String courtId);

    Integer insertCourtArea(@Param("courtId") String courtId, @Param("areaCode") String areaCode);

    List<CompanyTempStatistics> queryStatisticsMap(@Param("type") String type);

    List<SysCompanyDo> queryCourtList();
}